package com.xujiang.mytool.adapter;

import android.view.View;
import android.widget.TextView;

import com.xujiang.common_adapter.holder.BaseRecyclerViewHolder;
import com.xujiang.mytool.model.DirAndFileName;
import com.xujiang.mytool.R;

/**
 * @author xujiang
 * @version 2017-07-10 16:23
 */
public class MainDeviceListViewHolder<T extends DirAndFileName> extends BaseRecyclerViewHolder<T> {
    protected TextView filename;
    private View view;

    protected T mItem;

    public MainDeviceListViewHolder(View itemView) {
        super(itemView);
        filename = findViewById(R.id.file_name);
        view = findViewById(R.id.ll_dir);
        if(view == null){
            return;
        }
        view.setOnClickListener(new View.OnClickListener(){

            @Override
            public void onClick(View v) {
                switchDevice();
            }


        });
    }

    @Override
    public void onHandle(T item, int position) {
        mItem = item;
        filename.setText(item.getName());
    }

    protected void switchDevice() {

    }
}
